package Model;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class serialization {
    
    public void serial() throws FileNotFoundException, IOException{
       
        Contact serializedContact = new Contact();
        
        FileOutputStream fos = new FileOutputStream("Contact.serial");
        
        ObjectOutputStream oos = new ObjectOutputStream(fos); 
        try{
            oos.writeObject(serializedContact);
            System.out.println("\nSave successful");
            oos.flush();
            oos.close();
        }
        catch(IOException ioe){
            ioe.printStackTrace();
        }
    }
    
}
